home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19950929-19951130
/
000264_news@columbia.edu_Wed Nov 1 16:05:39 1995.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
2KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA09846
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Wed, 1 Nov 1995 11:05:50 -0500
Received: by apakabar.cc.columbia.edu id AA29929
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Wed, 1 Nov 1995 11:05:49 -0500
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: how to assign output of command to variable
Date: 1 Nov 1995 16:05:39 GMT
Organization: Columbia University
Lines: 31
Message-Id: <4785sj$t74@apakabar.cc.columbia.edu>
References: <4749uf$cr4@vodka.intele.net>
Nntp-Posting-Host: watsun.cc.columbia.edu
Apparently-To: kermit.misc@watsun.cc.columbia.edu
In article <4749uf$cr4@vodka.intele.net>,
Gerry Jensen <gerry@blue.intele.net> wrote:
: I am trying to write a Kermit script file for ckermit on a Unix system.
: I wish to assign the output from a Unix command to a variable similar
: to the following sh-style command:
:
: SomeVar=`ls`
:
: Is it possible to do something like this in a Kermit script? Something
: like:
:
: define \%a run ls ; (i know this doesn't work)
:
: i.e. assign the output from the ls command to the variable \%a ?
:
Yes:
open !read <command>
:LOOP
read \%a ; Reads a line from output of the command
if fail goto done ; This happens when the <command> exits
; Here do whatever you want to do with the line
goto loop
:DONE
In the example above, replace <command> by whatever command you want
to execute. See pages 269-272 of "Using C-Kermit" for details.
- Frank